<?php

/*
|--------------------------------------------------------------------------
| Admin Routes
|--------------------------------------------------------------------------
|
| This file is where you may override any of the routes that are included
| with Voyager.
|
*/

Route::group(['as' => 'role.','prefix'=>'admin'], function () {

    $namespacePrefix = '\\App\\Admin\\Controllers\\Roles\\';

    Route::group(['middleware' => ['admin.user']], function () use ($namespacePrefix) {

        Route::get('roles', ['uses' => $namespacePrefix . 'RoleController@index', 'as' => 'roles']);
        Route::get('roles/add/{id?}', ['uses' => $namespacePrefix . 'RoleController@add', 'as' => 'add']);
        Route::post('roles/add', ['uses' => $namespacePrefix . 'RoleController@postAdd', 'as' => 'post_add']);
        Route::get('roles/{id}/view', ['uses' => $namespacePrefix . 'RoleController@view', 'as' => 'view']);
        Route::delete('roles/delete/{id?}', ['uses' => $namespacePrefix . 'RoleController@deleteRole', 'as' => 'delete']);

    });

});
